namespace ContosoUniversity.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using System.Linq.Expressions;
    using NRepository.Core.Command;
    using NRepository.Core.Query;
    using NRepository.EntityFramework;

    public class EFLoggedRepositoryExtensions : IRepositoryExtensions
    {
        public static readonly EFLoggedRepositoryExtensions Instance = new EFLoggedRepositoryExtensions();

        private List<KeyValuePair<object, EntityState>> _Updates = new List<KeyValuePair<object, EntityState>>();

        private EFLoggedRepositoryExtensions()
        {
        }

        public void Load<TEntity, TElement>(IQueryRepository repository, TEntity entity, Expression<Func<TEntity, ICollection<TElement>>> navigationProperty, params IQueryStrategy[] strategies)
            where TEntity : class
            where TElement : class
        {
        }

        public void Load<TEntity, TElement>(IQueryRepository repository, TEntity entity, Expression<Func<TEntity, TElement>> navigationProperty, params IQueryStrategy[] strategies)
            where TEntity : class
            where TElement : class
        {
        }

        public void UpdateEntityState<TEntity>(ICommandRepository repository, TEntity entity, EntityState entityState) where TEntity : class
        {
            _Updates.Add(new KeyValuePair<object, EntityState>(entity, entityState));
        }

        public List<KeyValuePair<object, EntityState>> GetUpdates()
        {
            var retVal = _Updates.ToList();
            _Updates.Clear();
            return retVal;
        }

        public IEnumerable<T> ExecuteSqlQuery<T>(IQueryRepository repository, string sql, params object[] sqlParams)
        {
            throw new NotImplementedException();
        }

        public int ExecuteStoredProcudure(ICommandRepository repository, string sql, params object[] sqlParams)
        {
            throw new NotImplementedException();
        }

        public void Load<TEntity, TElement>(IQueryRepository repository, TEntity entity, Expression<Func<TEntity, IList<TElement>>> navigationProperty, params IQueryStrategy[] strategies)
            where TEntity : class
            where TElement : class
        {
            throw new NotImplementedException();
        }
    }
}
